package com.ym.medical.enums;

import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.util.StdConverter;
import com.ym.common.annotations.EnumDescription;
import com.ym.common.constant.DictEnum;

/**
 * 健康币获取渠道
 */
@EnumDescription("健康币获取渠道")
public enum HealthCoinSourceEnum implements DictEnum {

    //--------------------start-----------------

    /**
     * 签到
     */
    SIGN_IN("01","签到"),
    /**
     * 充值
     */
    TOP_UP("02","充值"),
    /**
     * 邀请好友
     */
    INVITE_FRIENDS("03","邀请好友"),
    /**
     * 绑定手机号
     */
    BINDING_MOBILE_PHONE_NUMBER("04","绑定手机号"),
    /**
     * 设置头像
     */
    SET_HEAD("05","设置头像"),

    /**
     * 兑换优惠劵
     */
    CASH_COUPON("06","兑换优惠劵"),

    //--------------------end-------------------
    ;
    private String key;

    private String value;

    HealthCoinSourceEnum(String key, String value) {
        this.key = key;
        this.value = value;
    }

    @Override
    public String getKey() {
        return this.key;
    }

    @Override
    public String getValue() {
        return this.value;
    }

    /**
     * 序列化使用
     */
    public static class Covert extends StdConverter<String, JSONObject> {
        @Override
        public JSONObject convert(String value) {
            return DictEnum.valueOfJson(HealthCoinSourceEnum.class,value);
        }
    }
}
